I have coding for one style of button, but I would like to add another kind of button. If the external CSS code for the first button is this, what coding would I add for the second button? - #button a {
-
display: block;
-
background: url(rolloverimage.gif) top;
-
width: 63px;
-
height: 34px;
-
}
-
-
#button a:hover {
-
background: url(rolloverimage.gif) bottom;
-
width: 63px;
-
height: 34px;
-
}
I suggest reading up on CSS id's and names. What you have there is #button, which is referencing a button with the id='button'.
If you change that to class='button' then your CSS would be:
If you add a different ID or class to your second button, you can style it with: - .button2 { ...
-
/* OR */
-
#button2 { ...
Just remember, ID's are for unique elements (only one) whereas classes are for common elements.
4 1817
I suggest reading up on CSS id's and names. What you have there is #button, which is referencing a button with the id='button'.
If you change that to class='button' then your CSS would be:
If you add a different ID or class to your second button, you can style it with: - .button2 { ...
-
/* OR */
-
#button2 { ...
Just remember, ID's are for unique elements (only one) whereas classes are for common elements.
- #button1 a,
-
#button2 a {
-
display: block;
-
background: url(rolloverimage.gif) top;
-
width: 63px;
-
height: 34px;
-
}
-
#button1 a:hover,
-
#button2 a:hover {
-
background: url(rolloverimage.gif) bottom;
-
width: 63px;
-
height: 34px;
-
}
@mariko
I ended up using all the code for a button, but instead of calling it a button I put in a different word. It worked. Is there any reason that I shouldn't do that?
@mariko
The class and ID can be called what ever you want. Provided the ID is unique and there is no other element with that ID. There can me lots of elements with the same class.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: news.hku.hk |
last post by:
I would like to group different kinds of food.
There are unknown number of kinds of food e.g. apple, orange, lemon, melon,
.........
of course it's only a finite number but i don't know.
also...
|
by: turnstyle |
last post by:
Hi all,
I'm hoping somebody here might be able to point me in the right
direction.
Basically, I'm looking for a "good" way to build tables such that
different kinds of stuff can grouped.
...
|
by: Aravind |
last post by:
Hi folks.
I have a form, frmHistory, which has 4 command buttons: Sort Title
(cmdSortTitle), Sort Name (cmdSortName), Due Today (cmdDueToday), and
Due List (cmdDueList).
Sort Title and Sort...
|
by: Natt Serrasalmus |
last post by:
After years of operating without any coding standards whatsoever, the
company that I recently started working for has decided that it might be a
good idea to have some. I'm involved in this...
|
by: pmud |
last post by:
Hi,
I have created a very simple ASP.NET application which has a couple of
ImageButtons which go to different SQL reports on clicking them. I have used
Response.Redirect to send the user to the ...
|
by: fff_afafaf |
last post by:
Do you know is it possible to put different kinds of tuples to one
container?
E.g. to a vector?
(The lengths of the tuples are different, and also the types in the
tuples are different..
-Is it...
|
by: burgermeister01 |
last post by:
First, let me say that this question is a rather general programming
question, but the context is PHP, so I figured this group would have
the most relevant insight.
Anyways, this is also more of...
|
by: Thomas Guettler |
last post by:
If you look at this code, you see there are two kind of ImportErrors:
1. app_name has no attribute or file managment.py: That's OK.
2. managment.py exists, but raises an ImportError: That's not...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |